﻿<!--_meta 作为公共模版分离出去-->
{include file="public/meta" /}
<!--/meta 作为公共模版分离出去-->
<title>基本设置</title>
<meta name="keywords" content="h-ui.admin.pro v1.0,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载">
<meta name="description" content="h-ui.admin.pro v1.0，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">
</head>

<body>
	<div class="wap-container">
		<nav class="breadcrumb" style="background-color:#fff;padding: 0 24px">
			首页
			<span class="c-gray en">/</span>
			系统管理
			<span class="c-gray en">/</span>
			系统设置
			<a class="btn btn-success radius f-r" style="line-height:1.6em;margin-top:3px"
				href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
		</nav>
		<article class="Hui-admin-content clearfix">
			<div class="panel">
				<div class="panel-body">
					<form action="" method="post" class="form form-horizontal" id="form-system-base">
						<div id="tab-system" class="HuiTab">
							<div class="tabBar cl"><span>基本设置</span><span>安全设置</span><span>邮件设置</span></div>
							<div class="tabCon">
								<div class="row clearfix">
									<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>小红书：</label>
									<div class="form-controls col-xs-8 col-sm-9">
										<input type="text" name="xiaohongshu" placeholder="" value="{$model.xiaohongshu}"
											class="input-text">
									</div>
								</div>
								<div class="row clearfix">
									<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>新浪微博：</label>
									<div class="form-controls col-xs-8 col-sm-9">
										<input type="text" name="weibo" placeholder="" value="{$model.weibo}"
											class="input-text">
									</div>
								</div>
								<div class="row clearfix">
									<label class="form-label col-xs-4 col-sm-2"><span
											class="c-red">*</span>官方微信：</label>
									<div class="form-controls col-xs-8 col-sm-9">
										<input type="text" name="wechat" placeholder="" value="{$model.wechat}"
											class="input-text">
									</div>
								</div>
								<div class="row clearfix">
									<label class="form-label col-xs-4 col-sm-2"><span
											class="c-red">*</span>ios：</label>
									<div class="form-controls col-xs-8 col-sm-9">
										<input type="text" name="ios" placeholder="" value="{$model.ios}"
											class="input-text">
									</div>
								</div>
								<div class="row clearfix">
									<label class="form-label col-xs-4 col-sm-2"><span
											class="c-red">*</span>安卓：</label>
									<div class="form-controls col-xs-8 col-sm-9">
										<input type="text" name="android" placeholder=""
											value="{$model.android}" class="input-text">
									</div>
								</div>
								<div class="row clearfix">
									<label class="form-label col-xs-4 col-sm-2"><span
											class="c-red">*</span>小程序：</label>
									<div class="form-controls col-xs-8 col-sm-9">
										<input type="text" name="xiaochengxu" placeholder=""
											   value="{$model.xiaochengxu}" class="input-text">
									</div>
								</div>
								<div class="row clearfix">
									<label class="form-label col-xs-4 col-sm-2"><span
											class="c-red">*</span>版本号：</label>
									<div class="form-controls col-xs-8 col-sm-9">
										<input type="text" name="version" placeholder=""
											   value="{$model.version}" class="input-text">
									</div>
								</div>
								<div class="row clearfix" style="display:none">
									<label class="form-label col-xs-4 col-sm-2"><span
											class="c-red">*</span>网站名称：</label>
									<div class="form-controls col-xs-8 col-sm-9">
										<input type="text" id="websiteTitle" name="websiteTitle"
											placeholder="控制在25个字、50个字节以内" value="" class="input-text">
									</div>
								</div>
								<div class="row clearfix" style="display:none">
									<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>关键词：</label>
									<div class="form-controls col-xs-8 col-sm-9">
										<input type="hidden" id="websiteKeywords" name="websiteKeywords"
											placeholder="5个左右,8汉字以内,用英文,隔开" value="" class="input-text">
									</div>
								</div>
								<div class="row clearfix" style="display:none">
									<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>描述：</label>
									<div class="form-controls col-xs-8 col-sm-9">
										<input type="hidden" id="websiteDescription" name="websiteDescription"
											placeholder="空制在80个汉字，160个字符以内" value="" class="input-text">
									</div>
								</div>
								<div class="row clearfix" style="display:none">
									<label class="form-label col-xs-4 col-sm-2"><span
											class="c-red">*</span>css、js、images路径配置：</label>
									<div class="form-controls col-xs-8 col-sm-9">
										<input type="hidden" id="websiteStatic" name="websiteStatic"
											placeholder="默认为空，为相对路径" value="" class="input-text">
									</div>
								</div>
								<div class="row clearfix" style="display:none">
									<label class="form-label col-xs-4 col-sm-2"><span
											class="c-red">*</span>上传目录配置：</label>
									<div class="form-controls col-xs-8 col-sm-9">
										<input type="hidden" id="websiteUploadfile" name="websiteUploadfile"
											placeholder="默认为uploadfile" value="" class="input-text">
									</div>
								</div>
								<div class="row clearfix" style="display:none">
									<label class="form-label col-xs-4 col-sm-2"><span
											class="c-red">*</span>底部版权信息：</label>
									<div class="form-controls col-xs-8 col-sm-9">
										<input type="hidden" id="websiteCopyright" name="websiteCopyright"
											placeholder="&copy; 2018 H-ui.net" value="" class="input-text">
									</div>
								</div>
								<div class="row clearfix">
									<label class="form-label col-xs-4 col-sm-2">微信二维码：</label>
									<div class="form-controls col-xs-8 col-sm-9">
                            <span id="img-list-box">
                                 {if ($model.wechat_img)}
                            <div style="position: relative;margin-right: 20px;margin-bottom: 15px;width: 132px;display: inline-block;border: 1px solid #CCC;background:#EEE;">
                                <span style="display: block;width: 197px;height: 267px;border: 1px solid #F2F1F0;margin: 5px;overflow: hidden;">
                                    <img src="{$model.wechat_img}" style="width: 100%;"/>
                                </span>
                                <input type="hidden" name="wechat_img" value="{$model.wechat_img}"/>
                                    <a onclick="delImg(this);"
									   style="z-index: 10;display: block;top: -8px;cursor:pointer;right: -8px;position:absolute;width: 20px;height: 20px;background: #CCC;border-radius:100%;text-align:center;line-height: 20px;border: 1px solid #C1C1C1;color: #555;">X</a>
                            </div>
                            {/if}
                            </span>
										<span class="yibu_image">
        <a class="yibu_biaoqian">图片上传</a>
                                 <input type="file"
										class="yibu_input"

										id="up-img-file" onchange="upimg(this)">
     </span>
									</div>
								</div>
								<div class="row clearfix" style="display:none">
									<label class="form-label col-xs-4 col-sm-2">备案号：</label>
									<div class="form-controls col-xs-8 col-sm-9">
										<input type="hidden" id="websiteIcp" name="websiteIcp"
											placeholder="京ICP备00000000号" value="" class="input-text">
									</div>
								</div>
								<div class="row clearfix">
									<label class="form-label col-xs-4 col-sm-2">注意事项</label>
									<div class="form-controls col-xs-8 col-sm-9">
										<script id="articleEditor" type="text/plain"
											style="width:100%;height:400px;"></script>
									</div>
								</div>
							</div>
							<div class="tabCon">
								<div class="row clearfix">
									<label class="form-label col-xs-4 col-sm-2">允许访问后台的IP列表：</label>
									<div class="form-controls col-xs-8 col-sm-9">
										<textarea class="textarea"></textarea>
									</div>
								</div>
								<div class="row clearfix">
									<label class="form-label col-xs-4 col-sm-2">后台登录失败最大次数：</label>
									<div class="form-controls col-xs-8 col-sm-9">
										<input type="text" id="" value="5" class="input-text">
									</div>
								</div>
							</div>
							<div class="tabCon">
								<div class="row clearfix">
									<label class="form-label col-xs-4 col-sm-2">邮件发送模式：</label>
									<div class="form-controls col-xs-8 col-sm-9">
										<input type="text" id="" value="" class="input-text">
									</div>
								</div>
								<div class="row clearfix">
									<label class="form-label col-xs-4 col-sm-2">SMTP服务器：</label>
									<div class="form-controls col-xs-8 col-sm-9">
										<input type="text" id="" value="" class="input-text">
									</div>
								</div>
								<div class="row clearfix">
									<label class="form-label col-xs-4 col-sm-2">SMTP 端口：</label>
									<div class="form-controls col-xs-8 col-sm-9">
										<input type="text" id="" value="25" class="input-text">
									</div>
								</div>
								<div class="row clearfix">
									<label class="form-label col-xs-4 col-sm-2">邮箱帐号：</label>
									<div class="form-controls col-xs-8 col-sm-9">
										<input type="text" id="email-name" value="" class="input-text">
									</div>
								</div>
								<div class="row clearfix">
									<label class="form-label col-xs-4 col-sm-2">邮箱密码：</label>
									<div class="form-controls col-xs-8 col-sm-9">
										<input type="password" id="email-password" value="" class="input-text">
									</div>
								</div>
								<div class="row clearfix">
									<label class="form-label col-xs-4 col-sm-2">收件邮箱地址：</label>
									<div class="form-controls col-xs-8 col-sm-9">
										<input type="text" id="email-address" value="" class="input-text">
									</div>
								</div>
							</div>
						</div>
						<div class="row clearfix">
							<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
								<button onClick="article_save_submit();" class="btn btn-primary radius" type="submit"><i
										class="Hui-iconfont">&#xe632;</i> 保存</button>
								<button onClick="layer_close();" class="btn btn-default radius"
									type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
							</div>
						</div>
					</form>
				</div>
			</div>
		</article>
	</div>
	<!--_footer 作为公共模版分离出去-->
	{include file="public/footer" /}
	<!--/_footer /作为公共模版分离出去-->
	<!--请在下方写此页面业务相关的脚本-->
	<script type="text/javascript" src="{__STATIC_PATH}admin/lib/webuploader/0.1.5/webuploader.min.js"></script>
	<script type="text/javascript" src="{__STATIC_PATH}admin/lib/ueditor/1.4.3/ueditor.config.js"></script>
	<script type="text/javascript" src="{__STATIC_PATH}admin/lib/ueditor/1.4.3/ueditor.all.min.js"></script>
	<script type="text/javascript" src="{__STATIC_PATH}admin/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
	<script type="text/javascript" src="{__STATIC_PATH}admin/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
	<script type="text/javascript" src="{__STATIC_PATH}admin/lib/jquery.validation/1.14.0/validate-methods.js"></script>
	<script type="text/javascript" src="{__STATIC_PATH}admin/lib/jquery.validation/1.14.0/messages_zh.js"></script>
	<script type="text/javascript">
		function upimg(obj) {
			if (obj.value == "") {
				return;
			}
			var formdata = new FormData();
			//<input type="file" name="img" value="" />
			formdata.append("img", $(obj)[0].files[0]);//获取文件法二
			$.ajax({
				type: 'post',
				url: "image", //接口
				data: formdata,
				cache: false,
				processData: false, // 不处理发送的数据，因为data值是Formdata对象，不需要对数据做处理
				contentType: false, // 不设置Content-type请求头
				success: function (response) {
					// console.log(response);
					var html = '<div style="position: relative;margin-right: 20px;margin-bottom: 15px;width: 132px;display: inline-block;border: 1px solid #CCC;background:#EEE;">'
							+ '<span style="display: block;width: 197px;height: 267px;border: 1px solid #F2F1F0;margin: 5px;overflow: hidden;">'
							+ '<img src="' + response + '" style="width: 100%;" />'
							+ '</span>'
							+ '<input type="hidden" name="wechat_img" value="' + response + '" />'
							+ '<a onclick="delImg(this);" style="z-index: 10;display: block;top: -8px;cursor:pointer;right: -8px;position:absolute;width: 20px;height: 20px;background: #CCC;border-radius:100%;text-align:center;line-height: 20px;border: 1px solid #C1C1C1;color: #555;">X</a>'
							+ '</div>';

					$('#img-list-box').html(html);
				},
				error: function () {
				}
			});
		}

		function delImg(obj) {
			$(obj).parent('div').remove();
		}
		function layer_close() {
			var index = parent.layer.getFrameIndex(window.name);
			parent.layer.close(index);
		}
		$(function () {
			$('.skin-minimal input').iCheck({
				checkboxClass: 'icheckbox-blue',
				radioClass: 'iradio-blue',
				increaseArea: '20%'
			});
			$("#tab-system").Huitab();
			var ue = UE.getEditor('articleEditor');
			$("#form-system-base").validate({
				onkeyup: false,
				focusCleanup: false,
				success: "valid",
				submitHandler: function (form) {
					$.ajax({
						url: "/admin/system/config_add",
						type: "post",
						data: $("form").serialize(),
						success: function (res) {
							if (res.code == 1) {
								layer.msg(res.msg, {
									icon: 1,
									time: 1000 //2秒关闭（如果不配置，默认是3秒）
								}, function () {
									//do something
									location.reload();
								});
							} else {
								layer.msg(res.msg, { icon: 2, time: 1000 });
							}
						}
					})
				}
			});
		});
	</script>
	<!--/请在上方写此页面业务相关的脚本-->
</body>

</html>